//
//  ZXZNetworkManager+exten.swift
//  up_learnWB
//
//  Created by Mac on 16/10/23.
//  Copyright © 2016年 www.ZXZ123.com. All rights reserved.
//

import UIKit

extension ZXZNetworkManager{


    // 获取用户的列表 若指定此参数，则返回ID比since_id大的微博（即比since_id时间晚的微博），默认为0。


    func loadListData(since_id:Int64 = 0, max_id:Int64 = 0,  result:@escaping (_ callData:[[String:AnyObject]]?, _ isSuccess:Bool)->()) -> () {

        
        let URLString:String = "https://api.weibo.com/2/statuses/home_timeline.json"

        let para:[String:AnyObject] = ["since_id":"\(since_id)" as AnyObject,
                    "max_id":"\(max_id)" as AnyObject]
        
        ZXZNetworkManager.shareTools.takeToken(URLString: URLString, parameters: para) { (data: Any?,   isSuccess: Bool) in
            if isSuccess{
                let  outData = data as! [String:AnyObject]
                let  ourArray =  outData["statuses"] as? [[String : AnyObject]]

                result(ourArray, isSuccess)
            }
        }


    }

}
